home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-01-19 | 1.1 KB | 38 lines | [TEXT/ToyS] |
- OpenProgress("A Progress Example…", 260, "Starting up.")
- repeat with n from 1 to 260
- UpdateProgress(n)
- if n = 20 then
- DescribeProgress("Entering first phase.")
- else if n = 60 then
- DescribeProgress("Entering second phase.")
- else if n = 100 then
- DescribeProgress("Main phase.")
- else if n = 200 then
- DescribeProgress("Entering final phase.")
- else if n = 240 then
- DescribeProgress("Finishing off.")
- end if
- end repeat
- CloseProgress()
-
- on OpenProgress(theTitle, theMax, aDescription)
- dd install with grayscale
- dd make dialog {size:[300, 50], style:movable dialog, name:theTitle, contents:[¬
- {class:static text, contents:aDescription, bounds:[8, 4, 290, 20]}, ¬
- {class:gauge, bounds:[10, 25, 290, 25 + 12], value:0, max value:theMax} ¬
- ]}
- end OpenProgress
-
- on UpdateProgress(aValue)
- dd set value of item 2 of dialog 1 to aValue
- dd interact with user for max ticks 0
- end UpdateProgress
-
- on DescribeProgress(aDescription)
- dd set contents of item 1 of dialog 1 to aDescription
- end DescribeProgress
-
- on CloseProgress()
- dd delete dialog 1
- if (dd count dialogs) = 0 then dd uninstall
- end CloseProgress